import Call from './call'


function get(url, params = {}) {
	return new Call((resolve, reject) => {
		uni.request({
		    url: url,
		    data: params,
		    success: (response) => {
				if (response.data.status == false) {
					uni.showModal({
					    title: '提示',
					    content: response.data.msg,
						showCancel: false
					});
				}
				resolve(response)
		    },
			fail: (response) => {
				console.log(response,'response');
				uni.showModal({
					title: '提示',
					content: '接口错误',
					showCancel: false
				});
				resolve(response)
			}
		});
	})
}

export default {
	get
}
